//
//  MZY_OnlyPicture.m
//  FullHouse
//
//  Created by dllo on 16/1/15.
//  Copyright © 2016年 yy. All rights reserved.
//

#import "MZY_OnlyPicture.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
#define HORIZONTAL [UIScreen mainScreen].bounds.size.width / 414
#define VERTICAL [UIScreen mainScreen].bounds.size.height / 736

@implementation MZY_OnlyPicture

- (void)dealloc
{
    [self.backView release];
    [self.picImageView release];
    [self.titleLabel release];
    [self.introduceLabel release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    self.backView = [[UIView alloc]init];
    self.backView.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.backView];
    [self.backView release];
    
    self.picImageView = [[UIImageView alloc]init];
    [self.backView addSubview:self.picImageView];
    [self.picImageView release];
    
    self.titleLabel = [[UILabel alloc]init];
    [self.picImageView addSubview:self.titleLabel];
    [self.titleLabel release];
    
    self.introduceLabel = [[UILabel alloc]init];
    [self.picImageView addSubview:self.introduceLabel];
    [self.introduceLabel release];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.backView.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    self.picImageView.frame = CGRectMake(0, 10, WIDTH, HEIGHT - 10);
    self.titleLabel.frame = CGRectMake(0, 60, WIDTH, 40);
    self.introduceLabel.frame = CGRectMake(130 * HORIZONTAL, 110, 120, 40 * VERTICAL);
}

@end
